#ifndef CNATIVEHANDLERLINUX_H
#define CNATIVEHANDLERLINUX_H

#include "CNativeHandler.h"

#ifdef Q_OS_LINUX

struct _XDisplay;
typedef _XDisplay Display;

struct xcb_connection_t;
typedef xcb_connection_t xcb_connection_t;

typedef unsigned int xcb_window_t;

class CNativeHandlerLinux : public CNativeHandler {
    Q_OBJECT
public:
    explicit CNativeHandlerLinux(QWidget *parent = nullptr);
    ~CNativeHandlerLinux();

protected:
    xcb_connection_t *connection;
    xcb_window_t rootWindow;
    Display *display;
    xcb_window_t windowHandle;

    int xiOpCode; // XInput
    unsigned int lastButtonPressTime;
    bool isSystemOpRunning; // resize or move

    void winIdChangeEventEx(QEvent *event) override;

    bool commonEventFilter(QEvent *event) override;
    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;

signals:
};

#endif

#endif // CNATIVEHANDLERLINUX_H
